﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>周边炉投入铝汤 - 表单</title>
    <link rel="stylesheet" href="../../css/base.css" />
    <link rel="stylesheet" href="../../css/index.css" />
    <style type="text/css">
        .btn-submit {
            display: block;
        }
    </style>
</head>
<body>
    <div id="caozuochengg" style="background-color:#fff; font-size:16px; border: solid 4px #ff0000; display:none;
 width:80%; padding:10px; position:absolute; top:50%;left:5%; z-index:9999; text-align:center;">操作成功！3秒后自动消失。</div>
    <div class="header">
        <!-- api.closeWin(); -->
        <span onclick="api.closeWin()" class="goBack" id="tishi" style="font-size: 10px;">返回</span>
        <span onclick="open_config()">机边炉加入铝汤</span>
        <span class="code" onclick="sjerweima()"><i class="H-iconfont H-icon-scanning H-font-size-28 H-vertical-middle"></i></span>
    </div>
    <div class="fingerprint bg-ybzck">
        <div class="textBox">
            <ul>
                <li>
                    <p>扫描机边保温炉二维码</p>
                    <input type="text" readonly="readonly" class="textStyle" name="FJBLNumber" id="inp1" onclick1="erweima(1,'YZJ')" />
                </li>
                <li>
                    <p>扫描汤包二维码，材料牌号</p>
                    <input type="text" readonly="readonly" class="textStyle" name="FTBNumber" id="inp2" onclick1="erweima(2,'ZYB')"
                           style="width:90px;" />
                    <input type="text" readonly="readonly" class="textStyle" name="TBCLPH" id="TBCLPH" onclick1="erweima(2,'ZYB')"
                           style="width:130px;" />
                </li>
                <li>
                    <p>扫描压铸产品二维码，材料牌号</p>
                    <input type="text" readonly="readonly" class="textStyle" name="FProNumber" id="inp3" onclick1="erweima(3,'CP')" />
                </li>
                <li>
                    <p>扫描转运操作工二维码</p>
                    <input type="text" readonly="readonly" class="textStyle" name="FEmplNameZY" id="inp4" onclick1="erweima(4,'YG')" />
                </li>
            </ul>
        </div>
        <p class="btn-submit" style="position:relative;">
            <input type="button" value="记录" class="btn btn2" onclick="db.openWin({url:'../zbltrltList/zbltrltList_body.html'})"
                   style="width: 90px;" />
            <input type="button" value="关闭" class="btn btn2" onclick="guanbi();" style="width: 90px;" />
            <!--<input type="button" value="日志" class="btn btn2" onclick="$('.kjjjskxjjx').show();" style="width: 90px;" />-->
            <input type="button" value="提交" class="btn btn2" style="width: 90px;" onclick="submitFun();" />
        </p>
    </div>
    <script src="../../script/base/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>

    <!-- <script type="text/javascript" src="../../script/jquery.signalR-2.2.0.js"></script> -->
    <!--<script type="text/javascript" src="http://47.91.250.49:9079/signalr/hubs"></script>-->
    <script src="../../script/layer/layer.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../script/DbHelper.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../script/webSocket.js"></script>
    <script type="text/javascript">
        //---------------signalr---------------------
        var machineHub;
        var toClientId = '';
        var isopen_config = 0;
        //弹窗
        function open_config() {
            isopen_config = 1;
            var html = $('#temp_config').html();
            var index = layer.open({
                type: 1,
                title: false,
                closeBtn: 0,
                shadeClose: false,
                area: ['300px', 'auto'],
                content: html,
                success: function () {
                    $('#jw_ip').val(localStorage.getItem("jw_ip") || '172.28.0.202');
                    $('#jw_port').val(localStorage.getItem("jw_port") || '8888');
                    $('#jw_userName').val(localStorage.getItem("jw_userName") || 'jwyclzspda');
                    $('#jw_toName').val(localStorage.getItem("jw_toName") || 'JWIKD5');
                }
            });
            $("#temp_config").data("index", index); //设置弹框id
        }
        //保存
        function bc_config() {
            localStorage.setItem("jw_ip", $('#jw_ip').val());
            localStorage.setItem("jw_port", $('#jw_port').val());
            localStorage.setItem("jw_userName", $('#jw_userName').val());
            localStorage.setItem("jw_toName", $('#jw_toName').val());
            //关闭层
            layer.close($("#temp_config").data("index"));
            //链接websocket
            var obj = {
                jw_ip: localStorage.getItem("jw_ip"),
                jw_port: localStorage.getItem("jw_port"),
                jw_userName: localStorage.getItem("jw_userName"),
                jw_toName: localStorage.getItem("jw_toName")
            }
            websocketObj.ip = obj.jw_ip;
            websocketObj.port = obj.jw_port;
            websocketObj.userName = obj.jw_userName;
            websocketObj.toName = obj.jw_toName;
            layer.msg('保存成功');
            isopen_config = 0;
            location.reload();
        }
        var websocketObj = {
            //websocket对象
            ws: null,
            //true：链接成功，false：链接失败
            isconn: false,
            setIntervalObj: setInterval(function () { }, 1),
            ip: '',
            port: '',
            toName: '',
            userName: ''
        };
        //WebSocket对象创建
        websocketObj.concact = function () {
            try {

                websocketObj.ws = new WebSocket("ws://" + websocketObj.ip + ":" + websocketObj.port);
                websocketObj.ws.onopen = function () {
                    $("#tishi").html('与服务器链接成功')
                    console.log('websocket---connect')
                    if (websocketObj.userName)
                        websocketObj.ws.send("LOGIN," + websocketObj.userName + ",密码信息");
                }
                websocketObj.ws.onmessage = function (evt) {
                    var data = evt.data;
                    //console.log(data)
                    $("#tishi").html('信号正常')
                    if (data && /^ACK/.test(data) && /LOGIN/.test(data)) {
                        websocketObj.isconn = true;
                        //console.log('login---ok')
                    }
                    //只有在测试的时候才弹出
                    if (data.indexOf('IKD投汤服务消息：') != -1 && isopen_config==1) {
                        layer.msg(data);
                    }
                }
                websocketObj.ws.onclose = function () {
                    //console.log('websocket---close')
                    $("#tishi").html('与服务器链接中断')
                    websocketObj.isconn = false;
                };
                websocketObj.ws.onerror = function () {
                    //console.log('websocket---error')
                    $("#tishi").html('与服务器链接异常')
                    websocketObj.isconn = false;
                };
            } catch (e) {
                //TODO handle the exception
            }
        }
        //每隔两秒验证一次websocket是否连接
        $(function () {

            layer.msg('版本号：v1.0.23');

            //没有设置过时弹出
            if (localStorage.getItem("jw_ip") == null) {
                open_config();
            } else {
                var obj = {
                    jw_ip: localStorage.getItem("jw_ip"),
                    jw_port: localStorage.getItem("jw_port"),
                    jw_userName: localStorage.getItem("jw_userName"),
                    jw_toName: localStorage.getItem("jw_toName")
                }
                websocketObj.ip = obj.jw_ip;
                websocketObj.port = obj.jw_port;
                websocketObj.userName = obj.jw_userName;
                websocketObj.toName = obj.jw_toName;
                //链接服务器websocket
                websocketObj.concact();
                layer.msg('点击标题，可以设置WebSocket参数');
                setInterval(function () {
                    try {
                        if (websocketObj.isconn)
                            websocketObj.ws.send("HEARTBEAT," + new Date().getTime());
                        else
                            websocketObj.concact();
                    } catch (e) {
                        console.log('webSocket发送失败')
                    }
                }, 2000);
            }
        })

        //关闭栏杆
        function guanbi() {
            active("0");
        }
        //测试关杆
        function testclose() {
            try {
                var sqp = testFVValue.split('.');
                //校验ip地址格式
                if (sqp.length != 4) {
                    layer.msg('极采盒IP地址：' + testFVValue + '；格式不正确！');
                    return;
                }
                var m = new Date();
                var time = new Date(m.getTime() + 1000 * 10);

                var Y = time.getFullYear();
                var M = getDate(time.getMonth() + 1);
                var d = getDate(time.getDate());
                var h = getDate(time.getHours());
                var m = getDate(time.getMinutes());
                var s = getDate(time.getSeconds());

                //测试模拟关闭时间
                var closetime = Y + '-' + M + '-' + d + ' ' + h + ':' + m + ':' + s;
                //压铸机ID,极彩盒IP地址
                websocketObj.ws.send("SEND," + websocketObj.toName + ",0;" + testFXMID + ";" + testFVValue + ";" + closetime + ";test;" +  websocketObj.userName);
                layer.msg('PDA发送“关”指令给服务器；<hr>；压铸机名称：' + testFXMName + '；<br>极采盒IP：' + testFVValue);
            } catch (e) { }
        }
        //测试抬杆
        function testopen() {
            try {
                var sqp = testFVValue.split('.');
                //校验ip地址格式
                if (sqp.length != 4) {
                    layer.msg('极采盒IP地址：' + testFVValue + '；格式不正确！');
                    return;
                }
                var m = new Date();
                var time = new Date(m.getTime() + 1000 * 10);

                var Y = time.getFullYear();
                var M = getDate(time.getMonth() + 1);
                var d = getDate(time.getDate());
                var h = getDate(time.getHours());
                var m = getDate(time.getMinutes());
                var s = getDate(time.getSeconds());

                //测试模拟关闭时间
                var closetime = Y + '-' + M + '-' + d + ' ' + h + ':' + m + ':' + s;
                //压铸机ID,极彩盒IP地址
                websocketObj.ws.send("SEND," + websocketObj.toName + ",1;" + testFXMID + ";" + testFVValue + ";" + closetime + ";test;" + websocketObj.userName);
                layer.msg('PDA发送“开”指令给服务器；<hr>压铸机名称：' + testFXMName + '；<br>极采盒IP：' + testFVValue);
            } catch (e) { }
        }
        function getDate(num) {
            if (num < 10) {
                return "0" + num;
            } else {
                return num;
            }
        }
        //是否正常连接着
        var optConfig = {};
        function active(status, EquipmentNumber, __IP, __dtime) {
            addlog(status, function (data1) {
                var data2 = eval('(' + data1 + ')');
                if (data2.msg.ds[0].status == '000000') {
                    //获取当前执行参数,打开栏杆
                    if (status == "1") {
                        optConfig.EquipmentNumber = EquipmentNumber;
                        optConfig.IP = __IP;
                        optConfig.dtime = __dtime.replace("T", " ");
                    }
                    if (optConfig.IP != '') {
                        $("#caozuochengg").html('操作成功！3秒后自动消失。<hr>唯一事件码：' + data2.msg.ds1[0].GUID);
                        if (optConfig.EquipmentNumber == '')
                            optConfig.EquipmentNumber = db.Data.get("YZJ");
                        websocketObj.ws.send("SEND," + websocketObj.toName + "," + status + ";" + optConfig.EquipmentNumber +
                            ";" + optConfig.IP + ";" + optConfig.dtime + ";" + data2.msg.ds1[0].GUID + ";" + websocketObj.userName);
                    } else {
                        var quyuID = db.Data.get("quyuID");
                        if (quyuID == 116) {
                            //alert('当前机台，缺少IP地址配置');
                        }
                    }
                }
            })
        }
        //允许摇一摇
        var yaoyiyao = true;
        //0表示一次扫描一次关闭   1表示连续扫描
        var autoS = 0;
        var ex = "";
        var save = true; //是否执行正常保存
        apiready = function () {
            //监听声音键
            db.syjt(function (ret, err) {
                sjerweima();
            });
            //获取之前的汤包信息
            if (db.Data.get("TBinp2k") != '') {
                $("#inp2").val('' + db.Data.get("TBinp2k"));
                db.Data.set("ZYB", "" + db.Data.get("TBinp2n"));
                //材料牌号
                $("#TBCLPH").val('' + db.Data.get("TBCLPH2k"));
            }

            //获取之前的转运工信息
            if (db.Data.get("reZYG") != '') {
                $("#inp4").val(db.Data.get("reZYG"));
            }

            ////触发了摇一摇事件
            //api.addEventListener({
            //    name: 'shake'
            //}, function (ret, err) {
            //    if (yaoyiyao) {
            //        //不允许摇一摇打开了
            //        yaoyiyao = false;
            //        sjerweima();
            //    }
            //});
        }
        //添加日志
        function addlog(status, fun) {
            db.ajax(function (ret, err) {
                //验证服务端是否执行正确，不正确则内部直接提示错误信息
                if (!db.dfc(ret, "api53251,返回数据格式错误，请联系IT部门！")) return;
                fun(ret)
            }, "api53251", "post", {
                FButtonType: status == '1' ? '开' : '关',
                FDeviceNo: '' + db.Data.get("YZJ"),
                FTBNumber: '' + db.Data.get("ZYB"),
                FProNumber: '' + db.Data.get("CP"),
                FLPID: '' + db.Data.get("_FLPID"),
                FRealName: '' + db.Data.get("YG"),
                PDATime: '',
                FCreater: db.login.Userid()
            }, {
                title: '提交中',
                text: '请耐心等待...'
            });
        }
        var setTimeoutObj1 = window.setTimeout(function () { }, 1);
        //提交
        function submitFun() {
            if ($("#inp1").val() == "") {
                logMsgFun("请扫描压铸机二维码");
                return;
            }
            if ($("#inp3").val() == "") {
                logMsgFun("请扫描产品二维码");
                return;
            }

            //提交前先服务器get一下请求，看看服务器是否通顺
            $.ajax({
                url: "http://172.28.0.202:9986/PCodeClient/ajax.ashx?cmd=before_get",
                type: "GET", 
                async: false, //同步方式
                timeout: 2000, //超时时间设置，单位毫秒
                success: function(ret) {
                    if(ret["status"]!='200'){
                        logMsgFun("网络暂时不通,请稍后提交");
                        return;
                    }
                },
                error: function() {
                    logMsgFun("网络暂时不通,请稍后提交");
                    return;
                }
            });

            db.ajax(function (ret, err) {
                //验证服务端是否执行正确，不正确则内部直接提示错误信息
                if (!db.dfc(ret)) return;
                var data = eval('(' + ret + ')');
                var das = data.msg.ds;
                var status = das[0].status, msg = das[0].msg;
                if (status == '000000') {
                    try {
                        //FSBBH 设备ID，FJCHDZ 地址，FGBSJ 关闭时间
                        //打开投汤栏杆
                        active("1", '' + das[0].FSBBH, '' + das[0].FJCHDZ, '' + das[0].FGBSJ);
                    } catch (e) {
                        //只记录，不提示
                        logMsgFun('远程连接生产设备【' + db.Data.get("YZJ") + '】失败，请手动操作生产设备！', false);
                    }
                    //只记录，不提示
                    logMsgFun(msg, false);
                    //显示成功提示内容
                    $("#caozuochengg").html(msg);
                    $("#caozuochengg").show();
                    //
                    try { window.clearTimeout(setTimeoutObj1); } catch (e) { }

                    try {
                        //3秒后隐藏成功提示内容
                        setTimeoutObj1 = window.setTimeout(function () {
                            $("#caozuochengg").hide();
                            $("#caozuochengg").html('');
                        }, 3000);
                    } catch (e) {
                        $("#caozuochengg").hide();
                        $("#caozuochengg").html('');
                    }

                    //清空炉号
                    $("#inp1").val('');
                    //db.Data.set("YZJ", "");
                    //清空产品
                    $("#inp3").val('');
                    db.Data.set("CP", "");
                } else {
                    logMsgFun(msg);
                    //db.Ts.toast(msg,2000,'x');
                }
            }, "insertZS_SoupTR", "post", {
                FJBLNumber: '' + db.Data.get("YZJ"),
                FTBNumber: '' + db.Data.get("ZYB"),
                FProNumber: '' + db.Data.get("CP"),
                //FLPID: ''+ db.Data.get("FLPID"),
                FLPID: '' + db.Data.get("_FLPID"),
                FEmplNameZY: '' + db.Data.get("YG"),
                FCreater: db.login.Userid()//db.Data.toInt(db.login.Userid(), 0)
            }, { title: '提交中', text: '请耐心等待...' });
        }

        //TC20的PDA，焦点做法才会被识别到该方法
        jw.scanfun = function (ret) {
            //区域编号
            var jwquyuID = db.Data.get("quyuID");
            //3号厂的TC20PDA使用该方法
            if (jwquyuID != null) {
                //连续扫描
                autoS = 0;
                scancode(ret);
            }
        }

        function scancode(ret) {
            var ipt1 = $("#inp1").val();
            var ipt2 = $("#inp2").val();
            var ipt3 = $("#inp3").val();
            //二维码解析
            db.Data.sjerweimajiexi(ret, function (q, n, k) {
                var s = 0;
                //随机扫描赋值
                if (q == "YZJ") {
                    s = 1;
                    db.Data.set("YZJ", n);
                    $("#inp1").val(k);
                    //吕昌
                    db.submit("M_Get_SBHQCP_a", {
                        FJBLNumber: n
                    }, function (ret, err) {
                        try {
                            var data = eval('(' + ret + ')');
                            var das = data.msg.ds;
                            if (das != undefined && das.length > 0) {
                                db.Data.set("CP", das[0].FID);
                                $("#inp3").val(das[0].FName);
                            }
                        } catch (e) { }
                    });
                    if (!testFVValue) getInfovv(ret);//如果没有极彩盒IP地址就 获取一些信息 liwj 20210220
                    //重新打开红外线
                    if (sess() && autoS == 1) sjerweima();
                }
                if (q == "ZYB") {
                    s = 1;
                    $("#inp2").val(k);
                    //记录汤包信息，下次可以不用重复扫
                    db.Data.set("TBinp2n", n);
                    db.Data.set("TBinp2k", k);
                    //获取材料牌号
                    getCLPH(n, 'ZYB', function (val) {
                        $("#TBCLPH").val('' + val);
                        db.Data.set("TBCLPH2k", val);
                    });
                    //重新打开红外线
                    if (sess() && autoS == 1) sjerweima();
                }
                if (q == "CP") {
                    s = 1;
                    //临时存储
                    db.Data.set("CP", n);
                    $("#inp3").val(k);
                    //重新打开红外线
                    if (sess() && autoS == 1) sjerweima();
                }
                if (q == "YG") {
                    s = 1;
                    $("#inp4").val(k);
                    //记录当前转运工
                    db.Data.set("reZYG", k);
                    //重新打开红外线
                    if (sess() && autoS == 1) sjerweima();
                }

                if (s <= 0) {
                    //db.Ts.toast('当前二维码非法',2000,'x');
                    return;
                }

                db.Data.set(q, n);
                //临时存储
                if (ipt1 == "" || ipt2 == "" || ipt3 == "") {
                    return;
                }
            });
        }
        //扫描二维码
        function erweima(val, type) {
            //区域编号
            var jwquyuID = db.Data.get("quyuID");
            //3号厂的TC20PDA使用该方法
            //if (jwquyuID != null) { return false; }
            db.hw({
                fun: function (ret, err) {
                    //非连续扫描
                    autoS = 0;
                    var ipt1 = $("#inp1").val();
                    var ipt2 = $("#inp2").val();
                    var ipt3 = $("#inp3").val();
                    //二维码解析
                    db.Data.erweimajiexi(ret, type, function (n, k) {
                        //记录汤包信息，下次可以不用重复扫
                        if (val == 2 && type == 'ZYB') {
                            db.Data.set("TBinp2n", n);
                            db.Data.set("TBinp2k", k);
                            //获取材料牌号
                            getCLPH(n, 'ZYB', function (val) {
                                $("#TBCLPH").val('' + val);
                                db.Data.set("TBCLPH2k", val);
                            });
                        }
                        //记录员工
                        if (type == 'YG') {
                            //记录当前转运工
                            db.Data.set("reZYG", k);
                        }
                        //临时存储
                        db.Data.set(type, n);
                        $("#inp" + val).val(k); //赋值
                        //吕昌
                        if (type == 'YZJ') {
                            db.submit("M_Get_SBHQCP_a", {
                                FJBLNumber: n
                            }, function (ret, err) {
                                try {
                                    var data = eval('(' + ret + ')');
                                    var das = data.msg.ds;
                                    if (das != undefined && das.length > 0) {
                                        db.Data.set("CP", das[0].FID);
                                        $("#inp3").val(das[0].FName);
                                    }
                                    if (data.msg.ds1 != undefined && data.msg.ds1.length > 0) {
                                        db.Data.set("_FLPID", data.msg.ds1[0].FLPID);
                                    }
                                } catch (e) { }
                            });
                        }

                        if (ipt1 == "" || ipt2 == "" || ipt3 == "") {
                            return;
                        }
                    });
                }
            });
        }

        //在连续扫描状态下，是否已经完成了所有的扫描
        //true：允许继续扫描，false：不允许继续扫描
        function sess() {
            if ($("#inp1").val() == '' || $("#inp2").val() == '' || $("#inp3").val() == '' || $("#inp4").val() == '')
                //允许继续扫描
                return true;
            //不允许扫描
            return false;
        }
        //压铸机ID,压铸机名称,极彩盒IP地址
        var testFXMID = '', testFXMName = '', testFVValue = '';
        //随机扫描
        function sjerweima() {
            //区域编号
            var jwquyuID = db.Data.get("quyuID");
            //3号厂的TC20PDA使用该方法
            if (jwquyuID != null) { return false; }
            db.hw({
                fun: function (ret, err) {
                    //测试抬杆功能
                    if (isopen_config == 1) {
                        var yzdat = eval('(' + ret + ')');
                        //随机扫描赋值
                        if (yzdat.q == "YZJ") {
                            db.ajax(function (ret, err) {
                                try {
                                    var retdat = eval('(' + ret + ')');
                                    //压铸机ID
                                    testFXMID = retdat.msg.ds1[0]["FXMID"];
                                    testFXMName = yzdat.d;
                                    //极彩盒IP地址
                                    testFVValue = retdat.msg.ds1[0]["FVValue"];
                                    layer.msg("压铸机=" + yzdat.d + "；<br>压铸机ID=" + testFXMID + ";<br>极彩盒IP地址=" + testFVValue);
                                } catch (e) { }
                            }, "api55042", "post", {
                                FCode: yzdat.n,/*压铸机编号(VarChar)*/
                                FCompanyID: jwquyuID
                            }, {
                                title: '提交中', text: '请耐心等待...'
                            });
                        }
                    } else {
                        //允许摇一摇
                        yaoyiyao = true;
                        //连续扫描
                        autoS = 1;
                    }
                    scancode(ret);
                }
            });
        }

        //如果没有极彩盒IP地址就 获取一些信息 
        function getInfovv(ret) {
            //区域编号
            var jwquyuID = db.Data.get("quyuID");
            //3号厂的TC20PDA使用该方法
            //if (jwquyuID != null) { return false; }
            //测试抬杆功能
            if (isopen_config == 1) {
                var yzdat = eval('(' + ret + ')');
                //随机扫描赋值
                if (yzdat.q == "YZJ") {
                    db.ajax(function (ret, err) {
                        try {
                            var retdat = eval('(' + ret + ')');
                            //压铸机ID
                            testFXMID = retdat.msg.ds1[0]["FXMID"];
                            testFXMName = yzdat.d;
                            //极彩盒IP地址
                            testFVValue = retdat.msg.ds1[0]["FVValue"];
                            layer.msg("压铸机=" + yzdat.d + "；<br>压铸机ID=" + testFXMID + ";<br>极彩盒IP地址=" + testFVValue);
                        } catch (e) { alert(e) }
                    }, "api55042", "post", {
                        FCode: yzdat.n,/*压铸机编号(VarChar)*/
                        FCompanyID: jwquyuID
                    }, {});
                }
            }
        }

    </script>
</body>
</html>
<script type="text/plain" id="temp_config" beizhu="模板">
    <div class="div_config" style="margin:0;background: #000;">
        <div class="textBox" style="padding-top:40px;">
            <ul>
                <li>
                    <p>IP</p>
                    <input type="text" class="textStyle" id="jw_ip" />
                </li>
                <li>
                    <p>端口</p>
                    <input type="text" class="textStyle" id="jw_port" />
                </li>
                <li>
                    <p>登入名</p>
                    <input type="text" class="textStyle" id="jw_userName" />
                </li>
                <li>
                    <p>上位机名</p>
                    <input type="text" class="textStyle" id="jw_toName" />
                </li>
            </ul>
        </div>
        <p class="btn-submit" style="text-align: center;">
            <input type="button" value="保存" class="btn btn2" style="width: 90px;" onclick="bc_config();" />
            <input type="button" value="测试抬杆" onclick="testopen()" />
            <input type="button" value="测试关杆" onclick="testclose()" />
        </p>
    </div>
</script>
